#ifndef _SIDE_H
#define _SIDE_H


/**
 * abstract base class for building sides, initialized in derived
 * classes to represent a certain side.
 */
#include "Frame.h"

class Side {
protected:	
	string name;
	int startAddr;		///< first window address
	int endAddr;			///< last window address
	int startRow;			///< index of top row in an overall numbering
	int endRow;			///< index of last row in an overall numbering
	int nrColumns;		///< number of columns
	int** windowAddrs;	///< window addresses of this side

public:
	
	string getName() {
		return name;
	}
	
	
	int getStartAddress() {
		return startAddr;
	}
	
	int getEndAddress() {
		return endAddr;
	}
	
	int getStartRow() {
		return startRow;
	}
	
	int getEndRow() {
		return endRow;
	}
	
	
	int getNrColumns() {
		return nrColumns;
	}
	
	/**
	 * retrieve the address of the window at a certain position
	 * @param row		index of row
	 * @param column	index of column
	 * @return			window address of row/column, -1 if no window at this position 
	 */
	/*
	int getAddress(int row, int column) {
		if (row >= startRow && row <= endRow) {
			if (column >= 0 && column < nrColumns) {
				return windowAddrs[row-startRow][column];
			}
		}
		return -1;
	}
	*/
	/**
	 * set side to a particular color
	 */
	/*
	public void setColor(FrameBuffer frame, Color color) {
		for (int address = getStartAddress(); address <= getEndAddress(); address++) {
			frame.setColor(address, color);
		}
	}
	*/
	/**
	 * set row of side to a particular color
	 */
	/*
	void setRowColor(FrameBuffer frame, int row, Color color) {
		if (row >= getStartRow() && row <= getEndRow()) {
			for (int column = 0; column < getNrColumns(); column++) {
				frame.setColor(getAddress(row, column), color);
			}
		}
	}
	*/
	/**
	 * set column of side to a particular color
	 */
	/*
	void setColumnColor(FrameBuffer frame, int column, Color color) {
		if (column >= 0 && column < getNrColumns()) {
			for (int row = getStartRow(); row <= getEndRow(); row++) {
				frame.setColor(getAddress(row, column), color);
			}
		}
	}
	*/
	/**
	 * set window at row/column to particular color.
	 * do nothing, if there is no window at that position.
	 */
	/*
	void setWindowColor(FrameBuffer frame, int row, int column, Color color) {
		frame.setColor(getAddress(row, column), color);
	}
	*/
};

#endif

